package com.faithnmn.utils.core.utils;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Utils {
public static Date convertUnixtimeMilisecondToDate(long timeStamp){
	Date date = new java.util.Date((long)timeStamp*1000);
	return date ;
}

public static Date convertUnixtimeToDate(long timeStamp){
	Date date = new java.util.Date((long)timeStamp);
	return date;
}

public static boolean isExpired(long timeStamp){
	Date currentDate = new Date();
	Date postedDate = convertUnixtimeToDate(timeStamp);
	if(postedDate.before(currentDate)){
		return true;
	}else return false;
}

public static String convertUnixtimeToDate(Date date){
	SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss dd-MM-yyyy"); 
//	sdf.setTimeZone(TimeZone.getTimeZone("GMT+7"));
	return sdf.format(date);
}

}
